#include <benchmark/benchmark.h>
#include "sys/types.h"
#include "sys/stat.h"
#include "dirent.h"
#include "util.h"

using namespace std;

static void Bm_function_Opendir(benchmark::State &state)
{
    mkdir("/data/data/test_opendir", S_IRWXU | S_IRWXG | S_IXGRP | S_IROTH | S_IXOTH);
    for (auto _ : state)
    {
        benchmark::DoNotOptimize(opendir("/data/data/test_opendir"));
    }
    state.SetItemsProcessed(state.iterations());
}

MUSL_BENCHMARK(Bm_function_Opendir);